package com.dyh.quickdemo.demos.beanReplace;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.concurrent.ForkJoinPool;

/*
@Author=Joey Wheeler
@Date=2021/1/7 19:44
*/
//@Component
@Slf4j
public class JscheduleConf {

    @Autowired
    ItfServiceA serviceA;

    @PostConstruct
    public void pc(){
        ForkJoinPool.commonPool().execute(
                ()->{
                    for (;;){
                        log.info("Jshcedule{}",serviceA.a());
                        try {
                            Thread.sleep(400);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                    }
                }
        );


    }


}
